SMODS.Back#
Class prefix: b
Required parameters:
key,loc_txtor localization entry (reference)
Optional parameters (defaults):
atlas = 'centers', pos = { x = 0, y = 0 }(reference)config = {}, unlocked = true, discovered = false, no_collection, prefix_config, dependencies, display_size, pixel_size(reference)configvalues will be saved underG.GAME.selected_back.effect.config
initial_deck: (Added in 1501a) Allows for easier customisation of your starting deck.ranks,suits: A list of ranks and suits to include/exclude.exclude = false: Iftrue,ranks/suitswill be treated as blacklists instead of whitelists.
API methods#
calculate(self, back, context)(reference)This method is called from
Back:trigger_effect()and incorporated into the standard calculation pipeline. This does not apply to vanillatrigger_effectfunctionality, which can be used as normal from this function by checking forcontext.context == 'eval'orcontext.context == 'final_scoring_steprespectively.Defining a
trigger_effectfunction on your deck is deprecated.
loc_vars, locked_loc_vars, generate_ui(reference)apply(self, back)Apply modifiers at the start of a run. If you want to modify the starting deck, you must use events to do so.
calc_dollar_bonus(self, back) -> number, table(Added in 1531zeebee)
For awarding money at the end of the round (e.g. Delayed Gratification, Cloud Nine)
Optionally, you can return a table as the second value to modify the text in the round evaluation screen with any of the following arguments:
text: Replaces the default name text.key,set: Allows changing the key and/or set of the name in the localization (ignored iftextis set)vars: (Added in 1814a) Replaces the variables (e.g.#1#) in names sourced from the localization.text_colour,scale: Allows changing the colour and scale of the text respectively
check_for_unlock(self, args) -> boolConfigure unlock conditions. Refer to the function
check_for_unlockin Balatro’s code for more information.